home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-10-04 | 3.0 KB | 100 lines |
- /*
- * This shows how to build a sub_arctic application.
- *
- * NOTE: This is NOT a member of the package sub_arctic.test so
- * you would need to make sure that . is in your class path, get
- * in the test directory and then do "java app_test". I did this
- * to make it easier for people to see how to write their own
- * apps.
- */
- import sub_arctic.input.*;
- import sub_arctic.lib.*;
- import sub_arctic.output.*;
- import sub_arctic.constraints.std_function;
-
- public class app_test extends interactor_app {
- /**
- * This is the main of the program, and all it should do is create
- * a new instance of its own type,initialize it, then return.
- */
- public static void main(String[] argv) {
- app_test at=new app_test(argv);
- at.initialize();
- /* done */
- }
- /**
- * You need to propagate the String[] to the superclass' constructor
- */
- public app_test(String[] argv) { super(argv);}
- /**
- * Parse the command line arguments here. For this test, I just
- * echo them to the terminal.
- */
- public boolean parse_arguments(String[] argv) {
- for (int i=0; i<argv.length; ++i) {
- System.out.println("argv["+i+"] = " + argv[i]);
- /* you must return true or the system thinks the arguments were bad */
- }
- return true;
- }
- /**
- * Application level data structure initialization.
- */
- public void app_initialize() {
- super.app_initialize();
- System.out.println("Should initialize application data structures here.");
- }
- /**
- * Frame initialization.
- */
- public void frame_initialize() {
- interactor_frame f;
- super.frame_initialize();
- System.out.println("Initializing the window system....");
- /* make a new frame with the hello world button in it */
- f=new hello_frame();
- /* put it on screen */
- f.show();
- }
-
- }
-
- /**
- * This is the other frame that we are embedding in this application.
- */
- class hello_frame extends interactor_frame {
- /**
- * Constructor
- */
- public hello_frame() {
- super("Hello!",null);
- }
- /**
- * Build the UI
- */
- public void build_ui(base_parent_interactor top) {
- button hello_button;
- /* put the button at 10, 10 and use 10 and 10 as the border sizes */
- hello_button=new button("Hello World!", null);
- top.add_child(hello_button);
- hello_button.set_x_constraint(std_function.centered(PARENT.X2(),0));
- hello_button.set_y_constraint(std_function.centered(PARENT.Y2(),0));
- }
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-